package com.cup.jpa.demo.server.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.cup.jpa.demo.model.User;
import com.cup.jpa.demo.repository.UserRepository;
import com.cup.jpa.demo.server.UserService;

@Service
public class UserServiceImpl implements UserService{
	
	@Autowired
	private UserRepository userrepo;
	
	@Override
	public List<User> getUserlist() {
		return userrepo.findAll();
	}

	@Override
	public User getUserById(int id) {
		return userrepo.findById(id).get();
	}
	

}
